package com.cedarhd.finance.bl.domain.repository;

import com.cedarhd.finance.bl.common.enums.Whether;
import com.cedarhd.finance.bl.domain.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Evan
 * @date 2018/3/5
 */
@Repository
public interface StudentRepository extends JpaRepository<Student,Integer>{
    /**
     * 根据有效状态查询学生列表
     * @param effective
     * @return
     */
    List<Student> findByEffective(Whether effective);

    /**
     * 复合条件的分页查询
     * @param spec
     * @param page
     * @return
     */
    Page<Student> findAll(Specification<Student> spec, Pageable page);

}
